Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: QuickTime Components /
Chapter 5 - Sequence Grabber Components / Sequence Grabber Components Reference
Application-Defined Functions /


MyDataFunction

The sequence grabber calls your data function whenever any of the grabber's channels write digitized data to the destination movie file. You assign a data function to the sequence grabber by calling the SGSetDataProc function, which is discussed on page 5-32.

Your data function must support the following interface:

pascal OSErr MyDataFunction (SGChannel c, Ptr p, long len, 
                              long *offset, long chRefCon,
                              TimeValue time, short writeType,
                              long refCon);
c
Identifies the channel component that is writing the digitized data.
p
Contains a pointer to the digitized data.
len
Indicates the number of bytes of digitized data.
offset
Contains a pointer to a field that may specify where you are to write the digitized data, and that is to receive a value indicating where you wrote the data. You must update the field referred to by this parameter, supplying the value indicated by the writeType parameter.
chRefCon
Contains control information. The low-order 16 bits contain sample flags for use by the Movie Toolbox's AddMediaSample function (see the chapter "Movie Toolbox" in Inside Macintosh: QuickTime for information about these flags). The sequence grabber sets these flags as appropriate.
The high-order 16 bits are reserved for Apple and are always set to 0.
time
Identifies the starting time of the data, in the channel's time scale. You may use the SGGetChannelTimeScale function to retrieve the channel's time scale (discussed on page 5-65).
writeType
Indicates the type of write operation being performed. The following values are defined:
seqGrabWriteAppend
Append the new data to the end of the file. Set the field referred to by the offset parameter to reflect the location at which you added the data.
seqGrabWriteReserve
Do not write any data to the output file. Instead, reserve space in the output file for the amount of data indicated by the len parameter. Set the field referred to by the offset parameter to the location of the reserved space.
seqGrabWriteFill

Write the data into the location specified by the field referred to by the offset parameter. Set that field to the location of the byte following the last byte you wrote.
This option is used to fill the space reserved previously when the writeType parameter was set to seqGrabWriteReserve. Note that the sequence grabber may call your data function several times to fill a single reserved location.
refCon
Contains the reference constant you specified when you assigned your data function to the sequence grabber.
DESCRIPTION
The sequence grabber calls your data function whenever any channel component writes data to the destination movie. You may use your data function to store the digitized data in some format other than a QuickTime movie.

RESULT CODES
File Manager errors
Memory Manager errors

SEE ALSO
You can instruct the sequence grabber not to write its data to a QuickTime movie by calling the SGSetDataOutput function and setting the seqGrabDontMakeMovie flag to 1. This can save processing time in cases where you do not want to create or update a movie. SGSetDataOutput is discussed on page 5-24.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996




Navigation graphic, see text links

Main | Top of Section | What's New | Apple Computer, Inc. | Find It | Feedback | Help